#ifndef __RENDER__CAMERA__CONTROLLER__INCLUDED__HH__
#define __RENDER__CAMERA__CONTROLLER__INCLUDED__HH__

#include <LitPointer.hpp>
#include <OgreCamera.h>

class RenderCameraController
{
	Lit::RefPtr<Ogre::Camera>		mCamera;
	Ogre::Real						mLookSpeed;
	Ogre::Real						mTravelSpeed;

	bool							mAlt, mCtrl, mShift;
public:
	RenderCameraController( Ogre::Camera * cam, Ogre::Real look_speed=1.0f, Ogre::Real travel_speed=1.0f );
	~RenderCameraController();

	bool isControlDown() const;
	bool isAltDown()const;
	bool isShiftDown() const;

	Ogre::Real lookSpeed() const;
	Ogre::Real travelSpeed() const;

	Ogre::Camera* camera();
	const Ogre::Camera* camera() const;
	
	void setLookSpeed( Ogre::Real spd );
	void setTravelSpeed( Ogre::Real spd );

	void pan( Ogre::Real angle_x, Ogre::Real angle_y );
	void tilt( Ogre::Real angle_x, Ogre::Real angle_y );

	Ogre::Vector3 right() const;
	Ogre::Vector3 direction() const;
	Ogre::Vector3 up() const;

	void checkModifiers( );

	void updateMouse( Ogre::Real mouse_dx, Ogre::Real mouse_dy, Ogre::Real frame_dt );
	void updateKeyboard(Ogre::Real frame_dt);

	void move( Ogre::Real x, Ogre::Real y, Ogre::Real z );
	void move( const Ogre::Vector3 &dir );
};
typedef Lit::RefPtr<RenderCameraController> RenderCameraControllerPtr;

#endif